/*
 * @Description:
 * @Author: mmzhang
 * @Date: 2022-07-12 11:27:32
 * @LastEditTime: 2022-12-15 15:50:40
 */
import server from '../index.js'

function post(path, auth = true, config = true) {
  return server.api().post(path).auth(auth).config(config)
}

function get(path, auth = true, config = true) {
  return server.api().get(path).auth(auth).config(config)
}

export default {
  // 基础利率配置
  rate: {
    interestRate: get('/dt-marketing/interestRate/page'), // 基础利率配置列表
    interestRateUpdate: post('/dt-marketing/interestRate/update') // 基础利率设置
  },

  // 背景图
  bgMap: {
    backgroundList: get('/dt-marketing/background/list'),
    backgroundOffList: post('/dt-marketing/background/page'),
    backgroundSave: post('/dt-marketing/background/save'),
    updateStateById: post('/dt-marketing/background/updateStateById'), //上下架
    updateById: post('/dt-marketing/background/updateById'), //编辑
    updateSortById: post('/dt-marketing/background/updateSortById'),
    templateList: get('/dt-marketing/shortArticle/template/list'),
    templatePage: post('/dt-marketing/shortArticle/template/page'),
    templateSave: post('/dt-marketing/shortArticle/template/save'),
    updateShortArticleTemplate: post('/dt-marketing/shortArticle/template/updateShortArticleTemplate'),
    templateUpdateById: post('/dt-marketing/shortArticle/template/updateById'),
    getTemplateById: get('/dt-marketing/shortArticle/template/getTemplateById'), //详情
    getTemplatePreview: get('/dt-marketing/shortArticle/template/preview') //上架模板列表
  },
  shortSrticle: {
    //短文章-增删改查
    getShortArticleSample: post('/dt-marketing/shortArticle/getShortArticleSample'), //查询样例
    shortSrticleSave: post('/dt-marketing/shortArticle/save'),
    shortSrticleDeleteById: post('/dt-marketing/shortArticle/deleteById'),
    shortSrticleUpdateById: post('/dt-marketing/shortArticle/updateById').setTimeout(50000),
    shortSrticleGetById: get('/dt-marketing/shortArticle/getById'),
    shortSrticlePage: post('/dt-marketing/shortArticle/page'), //分页查询短文章
    shortSrticleUpdateStateById: post('/dt-marketing/shortArticle/updateStateById'), //上下架短文章
    shortStatistics: post('/dt-marketing/shortArticle/statistics'), //上下架短文章
    pageWeb: post('/dt-marketing/articleSendRecord/pageWeb'), //web获取文章发送记录列表
    findShortArticleByIds: get('/dt-marketing/findShortArticleByIds'), // sop短文章列表
    initPageByChangeName: get('/dt-marketing/shortArticle/initPageByChangeName'), // sop短文章列表
    buildingPosterGetWebList: post('/dt-marketing/buildingPoster/getWebList'), // 分页查询案场海报
    buildingPosterCreate: post('/dt-marketing/buildingPoster/create'), // 分页查询案场海报
    posterPageList: post('/dt-user/poster/pageList'), // 分页查询案场海报
    getBuildingPosterById: get('/dt-marketing/buildingPoster/getBuildingPosterById'), //案场海报详情
    updateBuildingPoster: post('/dt-marketing/buildingPoster/updateBuildingPoster'),
    shortArticleExportPage: post('/dt-marketing/shortArticle/exportPage').tag('downloadCenter'), //霸屏神器导出
    buildingPosterExportWebList: post('/dt-marketing/buildingPoster/exportWebList').tag('downloadCenter'), //案场海报导出
    posterExportList: post('/dt-user/poster/exportList').tag('downloadCenter'), //自制海报导出
    delBuildingPoster: get(' /dt-marketing/buildingPoster/delBuildingPoster') //案场海报删除
  },
  companyCard: {
    companyPage: post('/dt-marketing/company/page'), //公司列表
    companyUpdate: post('/dt-marketing/company/update'), //编辑公司
    companygetByOrgId: post('/dt-marketing/company/getByOrgId'), //根据id查询公司
    getByUserCardAuditId: post('/dt-marketing/userCard/getByUserCardAuditId'), //根据id查询名片
    companyCreate: post('/dt-marketing/company/create'), //创建公司
    getByCompanyId: post('/dt-marketing/company/getById'), //根据id查询公司
    updateCompanyIntroduction: post('/dt-marketing/company/updateCompanyIntroduction'), //修改公司简介
    updateEnableStatus: post('/dt-marketing/company/updateEnableStatus'), //修改启用状态
    companyServicePage: post('/dt-marketing/companyService/page'), //分页查询公司服务信息
    companyServiceDel: post('/dt-marketing/companyService/delete'), //删除公司服务
    companyServiceCreate: post('/dt-marketing/companyService/create'), //创建公司服务
    companyServiceUpdate: post('/dt-marketing/companyService/update'), //编辑公司服务
    updateDisplayAndSort: post('/dt-marketing/companyService/updateDisplayAndSort'), //更新排序及显示
    getwxCodeUserCard: post('/dt-marketing/noToken/wx/getwxCodeUserCard'), //微信二维码
    companyServiceSortList: post('/dt-marketing/companyService/getByCompanyId'), //根据id查询公司服务排序规则数据
    //名片创建记录
    companyCardLog: {
      userCardCreatePage: post('/dt-marketing/userCard/page'), //名片创建记录api
      userCardExport: post('/dt-marketing/userCard/pageExport').tag('downloadCenter'), //导出-PC端管理, //名片创建记录导出
      userCardDelete: get('/dt-marketing/userCard/delete') //删除名片
    }
  },
  importArticle: {
    pageListWeb: get('/dt-marketing/importArticle/pageListWeb'), //分页查询-PC端管理
    importArticleSelect: get('/dt-marketing/importArticle/select/[id]'), //通过ID查询文章
    importArticleDelete: get('/dt-marketing/importArticle/delete'), //通过ID删除文章
    pageListWebExport: get('/dt-marketing/importArticle/pageListWebExport').tag('downloadCenter'), //导出-PC端管理
    importArticleDeleteIds: get('/dt-marketing/importArticle/deleteIds') // 推广记录的发文章删除
  },
  //码上获客
  customerForCode: {
    list: post('/dt-marketing/promote/activity/list'), //码上获客列表
    create: post('/dt-marketing/promote/activity/create'), //新增码上获客
    del: post('/dt-marketing/promote/activity/del'), //删除码上获客
    downloadPromoteCodeNew: server
      .api()
      .download('/dt-marketing/promote/activity/downloadPromoteCodeNew')
      .setTimeout(60000), //下载推广码
    detail: post('/dt-marketing/promote/activity/detail'), //码上获客详情
    update: post('/dt-marketing/promote/activity/update'), //更新码上获客
    listPromoteCode: post('/dt-marketing/promote/activity/listPromoteCode'), //获取活动所有推广码
    count: post('/dt-marketing/promote/activity/detail/count'), //码上获客详情统计
    detailExport: post('/dt-marketing/promote/activity/detail/export').tag('downloadCenter'), //码上获客详情-导出
    listExport: post('/dt-marketing/promote/activity/list/export').tag('downloadCenter'), //码上获客列表-导出
    point: {
      tokerList: post('/dt-marketing/promote/activity/tokerList'), //拓客码详情列表
      createPoint: post('/dt-marketing/maPromoteActivityPointPosition/create'), //新增点位
      delPoint: get('/dt-marketing/maPromoteActivityPointPosition/del'), //删除点位
      createToker: post('/dt-marketing/maPromoteActivityPointPosition/createToker'), //新增拓客码
      basicsTokerList: post('/dt-marketing/basics/tokerList'), //抽奖活动拓客码列表
      tokerListExport: post('/dt-marketing/promote/activity/tokerListExport').tag('downloadCenter'),
      getTokerAndChannelList: get('/dt-marketing/basics/getTokerAndChannelList') //新建点位获取拓客码/渠道列表
    }
  },
  // 推广
  promote: {
    settingInfo: get('/dt-marketing/promote/setting/info'),
    setting: post('/dt-marketing/promote/setting'),
    getPromoteExecuteList: post('/dt-marketing/promote/getPromoteExecuteList'),
    getPromoteExecuteCount: post('/dt-marketing/promote/getPromoteExecuteCount'),
    getPromoteExecuteExport: post('/dt-marketing/promote/getPromoteExecuteExport').tag('downloadCenter'),
    promoteList: post('/dt-marketing/promote/pc/list'),
    promoteCount: post('/dt-marketing/promote/pc/count'),
    promoteExport: post('/dt-marketing/promote/pc/export').tag('downloadCenter'),
    createPromoteRecord: post('/dt-marketing/promote/createPromoteRecord')
  },

  activity: {
    insertBasics: post('/dt-marketing/basics/insertBasics'),
    updateBasics: post('/dt-marketing/basics/updateBasics'),
    basicsList: post('/dt-marketing/basics/list'),
    selectBasics: get('/dt-marketing/basics/selectBasics'),
    endBasics: post('/dt-marketing/basics/endBasics'),

    publishBasics: get('/dt-marketing/basics/publishBasics'),
    getAcQrCode: post('/dt-marketing/basics/getAcQrCode'),
    acActivityCustomerPage: post('/dt-marketing/acActivityCustomer/page'),
    acActivityCustomerExport: post('/dt-marketing/acActivityCustomer/list/export').tag('downloadCenter'),

    lotteryMsgList: post('/dt-marketing/acLotteryRecord/lotteryMsgList'),
    activitySummary: post('/dt-marketing/basics/activitySummary'),

    exportLotteryMsgList: post('/dt-marketing/acLotteryRecord/exportLotteryMsgList').tag('downloadCenter')
  },
  // 广告
  advertisement: {
    getIndexAd: get('/dt-marketing/advertisement/getAdvListByOnShelf'), // 工作台首页展示广告
    getAdvListByOnShelf: post('/dt-marketing/orgPortAdvertisement/getOnShelfList'), // 上架列表查询
    getOnShelfStatistics: get('/dt-marketing/orgPortAdvertisement/getOnShelfStatistics'), // 上架列表各端口广告数查询
    getAdvListByOffShelf: post('/dt-marketing/advertisement/getAdvListByOffShelf'), // 下架列表查询
    getAdvPreview: post('/dt-marketing/orgPortAdvertisement/getAdvPreview'), // 广告位预览查询
    advPreviewExport: post('/dt-marketing/orgPortAdvertisement/advPreviewExport').tag('downloadCenter'), // 广告位预览导出
    create: post('/dt-marketing/advertisement/create'), // 新增广告
    update: post('/dt-marketing/advertisement/update'), // 修改广告
    delete: get('/dt-marketing/advertisement/deleteById'), // 删除广告
    updateOffShelf: get('/dt-marketing/orgPortAdvertisement/updateOffShelf'), // 下架广告
    updateAdvOnShelf: get('/dt-marketing/advertisement/updateAdvOnShelf').error('no'), // 上架广告
    updateDisplayTop: get('/dt-marketing/orgPortAdvertisement/updateDisplayTop'), // 组织广告置顶
    getAdvertisementById: get('/dt-marketing/advertisement/getAdvertisementById'), // 根据广告Id查询广告信息
    getRoleListByPort: get('/dt-marketing/portRole/getRoleListByPort'), // 根据广告端口获取角色列表
    updateRoleByPort: post('/dt-marketing/portRole/updateRoleByPort'), // 修改端口关联角色
    updateAdvDisplayOrder: post('/dt-marketing/advertisement/updateAdvDisplayOrder') // 上移 下移（当前已删除）
  }
}
